<template>
  <div>
    <el-breadcrumb separator="/">
      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>商品系统</el-breadcrumb-item>
      <el-breadcrumb-item>属性分组管理</el-breadcrumb-item>
    </el-breadcrumb>
    <el-card class="box-card">
      <el-row>
        <el-col :span="4">
          <bz-mall-category-tree @handleNodeClick="handleNodeClick"/>
        </el-col>
        <el-col :span="20">
          <el-table
            :data="attrGroups"
            style="width: 100%">
            <el-table-column
              header-align="center"
              align="center"
              type="index"
              label="序号"
            >
            </el-table-column>
            <el-table-column
              prop="attrGroupName"
              label="分组名称">
            </el-table-column>
            <el-table-column
              prop="sort"
              label="分组排序">
            </el-table-column>
            <el-table-column
              prop="descript"
              label="分组描述">
            </el-table-column>
            <el-table-column
              header-align="center"
              align="center"
              label="操作">

              <template slot-scope="scope">
                <el-button type="danger" size="mini">删除</el-button>
                <el-button type="warning" size="mini">编辑</el-button>
                <el-button type="primary" size="mini">关联属性</el-button>
              </template>
            </el-table-column>
          </el-table>
        </el-col>
      </el-row>
    </el-card>
  </div>

</template>

<script>
  import BzMallCategoryTree from "./BzMallCategoryTree";
export default {
  name: "BzMallAttrGroup",
  data(){
    return {
      attrGroups:[]
    }
  },
  components:{BzMallCategoryTree},
  methods:{
    handleNodeClick(data){
      this.axios.get("/admin/bzAttrGroup/attrGroupCid/"+data)
          .then(resp=>{
            this.attrGroups = resp.data.data;
          })
    }
  }
}
</script>

<style scoped>
  .el-card{
    margin-top:20px
  }
  .el-row{
    margin: 10px 0;
  }
</style>
